var router=require('express').Router();
var Note=require('../models/note');

module.exports=router;

router.get('/',(req,res,next)=>{
    Note.get(req.query,(err,ret)=>{
        if(err)return next(err);
        var {start,end}=req.query;
        var status={
            ygq:-1==req.query.status,
            wwc:0==req.query.status,
            ywc:1==req.query.status,
        };
        console.log('start/end/status:',start,end,status);
        res.render('home',{title:'All',notes:ret,query:{start,end,status}});
    });
});